package com.ruoyi.swimming.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.swimming.domian.SwimmingPool;
import com.ruoyi.swimming.domian.SwimmingTicketBindMember;
import com.ruoyi.swimming.mapper.SwimmingPoolMapper;
import com.ruoyi.swimming.mapper.SwimmingTicketBindMemberMapper;
import com.ruoyi.swimming.service.ISwimmingTicketBindMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;

/**
 * 绑定成员Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-07-17
 */
@Service
public class SwimmingTicketBindMemberServiceImpl extends ServiceImpl<SwimmingTicketBindMemberMapper, SwimmingTicketBindMember> implements ISwimmingTicketBindMemberService
{
    @Autowired
    private SwimmingTicketBindMemberMapper swimmingTicketBindMemberMapper;

    /**
     * 查询绑定成员
     * 
     * @param id 绑定成员ID
     * @return 绑定成员
     */
    @Override
    public SwimmingTicketBindMember selectSwimmingTicketBindMemberById(Long id)
    {
        return swimmingTicketBindMemberMapper.selectSwimmingTicketBindMemberById(id);
    }

    /**
     * 查询绑定成员列表
     * 
     * @param swimmingTicketBindMember 绑定成员
     * @return 绑定成员
     */
    @Override
    public List<SwimmingTicketBindMember> selectSwimmingTicketBindMemberList(SwimmingTicketBindMember swimmingTicketBindMember)
    {
        return swimmingTicketBindMemberMapper.selectSwimmingTicketBindMemberList(swimmingTicketBindMember);
    }

    /**
     * 新增绑定成员
     * 
     * @param swimmingTicketBindMember 绑定成员
     * @return 结果
     */
    @Override
    public int insertSwimmingTicketBindMember(SwimmingTicketBindMember swimmingTicketBindMember)
    {
        swimmingTicketBindMember.setCreateTime(DateUtils.getNowDate());
        return swimmingTicketBindMemberMapper.insert(swimmingTicketBindMember);
    }

    /**
     * 修改绑定成员
     * 
     * @param swimmingTicketBindMember 绑定成员
     * @return 结果
     */
    @Override
    public int updateSwimmingTicketBindMember(SwimmingTicketBindMember swimmingTicketBindMember)
    {
        swimmingTicketBindMember.setUpdateTime(DateUtils.getNowDate());
        return swimmingTicketBindMemberMapper.updateById(swimmingTicketBindMember);
    }

    /**
     * 批量删除绑定成员
     * 
     * @param ids 需要删除的绑定成员ID
     * @return 结果
     */
    @Override
    public int deleteSwimmingTicketBindMemberByIds(Long[] ids)
    {
        return swimmingTicketBindMemberMapper.deleteBatchIds(Arrays.asList(ids));
    }

    /**
     * 删除绑定成员信息
     * 
     * @param id 绑定成员ID
     * @return 结果
     */
    @Override
    public int deleteSwimmingTicketBindMemberById(Long id)
    {
        return swimmingTicketBindMemberMapper.deleteById(id);
    }
}
